<?php

Yii::import('application.models._base.BaseWbImage');

class WbImage extends BaseWbImage
{
	public static function model($className=__CLASS__) {
		return parent::model($className);
	}

    //配图入库
    public function storage($img,$tid){
        foreach($img as $key => $value){
            $data = array(
              'data'=>$value,
              'tid'=>$tid,
            );
            $db = new WbImage();
            $db->setAttributes($data);
            if(!$db->save()){
                return 0;
            }
        }
        return 1;
    }

}